package cn.wq.xa.mapper;

import cn.wq.xa.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDao {

    public List<User> findUserByName(String name);

    @Select("select * from user")
    public List<User> ListUser();

    @Select("select * from user where id=#{id}")
    public User findUser(int id);

    @Insert("insert into user (name,password,number) values (#{name},#{password},#{number})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    public int insertUser(User user);

    @Delete("delete from user where id=#{id}")
    public int delete(int id);

    @Update("update user set name=#{name},password=#{password},number=#{number} where id=#{id}")
    public int update(User user);
}
